package _021_10_6

func rotate(matrix [][]int) {
	temp := make([][]int, len(matrix))
	for i := 0; i < len(matrix); i++ {
		temp[i] = make([]int, len(matrix[i]))
	}

	for i := 0; i < len(matrix); i++ {
		for j := 0; j < len(matrix); j++ {
			temp[j][len(matrix)-1-i] = matrix[i][j]
		}
	}
	for i := 0; i < len(matrix); i++ {
		for j := 0; j < len(matrix); j++ {
			matrix[i][j] = temp[i][j]
		}
	}
}
